UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fF/VL8tM1m5k78R0EUEPV1+F+kFQhZXmq3/i3ECMCB0='
WHERE
key_id = 'b4d0e8efc63d16878634589877ea1fe970ec9e9c643e6fedfe91121ffd78482c'
AND (
token = 'fF/VL8tM1m5k78R0EUEPV1+F+kFQhZXmq3/i3ECMCB0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)