UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DVCJKygUFjfIlI1OMkvp5yGPkdUBGYSIAxJ3vjUdyQo='
WHERE
key_id = '2793cc5c8c0deba5d04a09776b5e7a6fe4d350878f49c4e58f242751ce9959ae'
AND (
token = 'DVCJKygUFjfIlI1OMkvp5yGPkdUBGYSIAxJ3vjUdyQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)