UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5hg0v7KJkYuXXwYKp3Oya+grg3YDkJr5Bvc+BorlUic='
WHERE
key_id = '4d798f843a37ac68b62ce7a85e4ae9d7bcc7a0a13d5df29c09c5cbbe98f9d322'
AND (
token = '5hg0v7KJkYuXXwYKp3Oya+grg3YDkJr5Bvc+BorlUic='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)