UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j+Ntu691LwJZ9e4WulPMpjQUgoLtBoaioxku9NhCNMc='
WHERE
key_id = '149e76604ad14107663c248017145d4dc4ac0757f0af64a6fbc0737212797ead'
AND (
token = 'j+Ntu691LwJZ9e4WulPMpjQUgoLtBoaioxku9NhCNMc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)