UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zirgEzeF8rKthI04Eb/CbqIp53m1PVU1Cb1uLZ1On+M='
WHERE
key_id = 'e9065a25f104ea97a313d5d46ba0e663eeed2a1632553048af23465457c9a522'
AND (
token = 'zirgEzeF8rKthI04Eb/CbqIp53m1PVU1Cb1uLZ1On+M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)