UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zfyA9aEMuIcMS0Q5Ktdr46GpDELFvqxGnXl6IocPLmQ='
WHERE
key_id = '98e0e9c61647d9413889bf319b9ccbc9dd5153fcaa8b10f134873e496989379a'
AND (
token = 'zfyA9aEMuIcMS0Q5Ktdr46GpDELFvqxGnXl6IocPLmQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)