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