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