UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fl03uCKfryuPwZhMxK/MqRgp0YJyQZ3AXL1GjrdfMMQ='
WHERE
key_id = '3a0a77fc07286e6fea91be33405390367c58844a2b88db98cc4f42f65376bd0e'
AND (
token = 'fl03uCKfryuPwZhMxK/MqRgp0YJyQZ3AXL1GjrdfMMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)