UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mSXhKP2q/CliYSJeywRuwfrcEHZVvEtDTRUM7duAzrg='
WHERE
key_id = 'a14e52d7fc1f36dfd70ad5c32b0a844a47a9c31115a309dfdc74f6246d5cc911'
AND (
token = 'mSXhKP2q/CliYSJeywRuwfrcEHZVvEtDTRUM7duAzrg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)