UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PvEMU+xCeA6pwrvT1eGEm4XVxdy8d2nS01pPe5O1x94='
WHERE
key_id = 'a0e69ed6308ab8c993a2d8b2f4af4350ef2ca31dd7bce6fd9f6f48cf2ee9465c'
AND (
token = 'PvEMU+xCeA6pwrvT1eGEm4XVxdy8d2nS01pPe5O1x94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)