UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GY/1NQPMrGfv66B24BNCpic484chSNrT/G88cgVfnG4='
WHERE
key_id = '439e2a5b31cbf50d54c7728ec18b57ce7bb0241c54aea67f7d14e540a7b973f8'
AND (
token = 'GY/1NQPMrGfv66B24BNCpic484chSNrT/G88cgVfnG4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)