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