UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tNjlAurznU1Vxg8OUG7f9oMtRnWV8dhPTGkCdjzcmaQ='
WHERE
key_id = 'c5ed11eb4e1f87e3dcdedb71411183ba43c35fc65ddb74354aed53eae94dfc89'
AND (
token = 'tNjlAurznU1Vxg8OUG7f9oMtRnWV8dhPTGkCdjzcmaQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)