UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hTVSyP3hPHrVkxEbX7CQzaxojj9FkQ87q5oxAeWlNcU='
WHERE
key_id = '24bc33985e421049510cc0fc2fa4ed15bef440c52c34dc4bc8d8e9b3e5279fb3'
AND (
token = 'hTVSyP3hPHrVkxEbX7CQzaxojj9FkQ87q5oxAeWlNcU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)