UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gaiqax5iU9ZQmp7Aw3XydCo8Z8a8UY8ddTqq6CxBsrw='
WHERE
key_id = '7ba9c96fa57725fa8668da105215e9724147b8b6a58d5f033d4dfccd0dcebcdc'
AND (
token = 'gaiqax5iU9ZQmp7Aw3XydCo8Z8a8UY8ddTqq6CxBsrw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)