UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vRnvhiJGQ9sif0xhhYKXMvotiHo2ejKST19WMGakoY0='
WHERE
key_id = '2442fd56038f4832be9b916e64eea40a8c0fb26902ce92970653d80dda410b15'
AND (
token = 'vRnvhiJGQ9sif0xhhYKXMvotiHo2ejKST19WMGakoY0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)