UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bHXSTpRN0Ev6dcJ3B5os8twyDUcsLgXX4gI7YjNoEfE='
WHERE
key_id = '249220ae46ff10c9db1e6b9d0fc1198d1066623afe2601b2c5690e5b436e8a88'
AND (
token = 'bHXSTpRN0Ev6dcJ3B5os8twyDUcsLgXX4gI7YjNoEfE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)