UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vTf69Uebiju/DQbQeogtBoTHoWTGlE9tDLIbe5SVub8='
WHERE
key_id = 'fdac6bbf997f7c9beeb3edd08f0f41b388cb64aaf3218d0b327417ecd990b202'
AND (
token = 'vTf69Uebiju/DQbQeogtBoTHoWTGlE9tDLIbe5SVub8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)