UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0Icnkl9e1jBT4y4Le3odgpnIwps3wS3qTZjfhTWLEAU='
WHERE
key_id = '294bf723570b5ff4b16fa0c28560e71d17222bc7a0300eb7b78a0b1f9919ad86'
AND (
token = '0Icnkl9e1jBT4y4Le3odgpnIwps3wS3qTZjfhTWLEAU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)