UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NqkbgjUs2CrNbQKxek0duwgnLOdW0n0N1TmeX3ieiAw='
WHERE
key_id = '73e2ac430dbfb874fd72680745d5b58c333f44b3c2c0f7502f47de6a9affc321'
AND (
token = 'NqkbgjUs2CrNbQKxek0duwgnLOdW0n0N1TmeX3ieiAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)