UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aMHESp25QBRAkSZNY/RuiJgMWPHmp1eDEDubbmWeGRs='
WHERE
key_id = 'b26a7d0c9fe20ab5b58406fb65fa215c616e992693b2e1c6a3f2747675eb27e2'
AND (
token = 'aMHESp25QBRAkSZNY/RuiJgMWPHmp1eDEDubbmWeGRs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)