UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ArN2+sQAGxN8NdplHBcQ9dkxrrNZlI/TTx0vqNxiRDU='
WHERE
key_id = '20e5ab2d57e663c39822b4d8363a857ff220ab71aeb29087223e734c73aa0d03'
AND (
token = 'ArN2+sQAGxN8NdplHBcQ9dkxrrNZlI/TTx0vqNxiRDU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)