UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GdpNKJeO/dg+eaXtUuA1XHwhfwAd0WR+4Kqp4c/Z2CY='
WHERE
key_id = 'b92212b7684a4249d950f88e8a3b15837a53b0a4229c117b44b88fa49c4ec0c2'
AND (
token = 'GdpNKJeO/dg+eaXtUuA1XHwhfwAd0WR+4Kqp4c/Z2CY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)