UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xPQjN9dhkSUSzlkJS1dqh27V9RHseN3Zh5Czlh6zSEE='
WHERE
key_id = 'ededb1d8ddc752f3f53a538e5eb541407759a3bb1b98c800083e9dabc6516771'
AND (
token = 'xPQjN9dhkSUSzlkJS1dqh27V9RHseN3Zh5Czlh6zSEE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)