UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h6YzHrZcOjaoAHdYDSQh592B/4DpRe5RQJYvwnQ6cGE='
WHERE
key_id = 'a40475f72226c5cde76efdf8f3b3ab1749e009fc3406dcb13b5cc2fd6cf6e1e4'
AND (
token = 'h6YzHrZcOjaoAHdYDSQh592B/4DpRe5RQJYvwnQ6cGE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)