UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KVH0Cn1TcKfrxMHjPUuCKcmgB43hxFpXFVyxQwtNvks='
WHERE
key_id = '10eeab5513178f4d3e0fec5e3fa07fe32af279106a574e9aefb73f2f313f2b50'
AND (
token = 'KVH0Cn1TcKfrxMHjPUuCKcmgB43hxFpXFVyxQwtNvks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)