UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/sCh0vPoCi0UFNceIcFiY6ao6cs4OEXC44+ELv3DTu0='
WHERE
key_id = 'e13648a438c33d1446ff991a2abaaad0e9736ef1b4b96f6019807ce3aaf72b60'
AND (
token = '/sCh0vPoCi0UFNceIcFiY6ao6cs4OEXC44+ELv3DTu0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)