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