UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wWd4MRvOSwMEA4l42eNcPBv7fPQp5pRReQTCb2ayLCA='
WHERE
key_id = '0c7880881519622051c05256c1bbc86e6fe6268c4d1c6d5803da59c65a517b36'
AND (
token = 'wWd4MRvOSwMEA4l42eNcPBv7fPQp5pRReQTCb2ayLCA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)