UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/tiawo6CiAg6wpeaWRSQN1p9Y+AQdEdu7iyUQMEJJZY='
WHERE
key_id = 'ad3a22f12ba728fc7f846f0c037950830576b52c6dc79b53e21d69ae57dc365f'
AND (
token = '/tiawo6CiAg6wpeaWRSQN1p9Y+AQdEdu7iyUQMEJJZY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)