UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MiLIWgOkWAO3sslL60PqoNe1a2DfALvZhUdWOnqGiMY='
WHERE
key_id = '3b078451263710936c1b4004dc95cbd12e87dac387e3de01b00f5bfd95c792f6'
AND (
token = 'MiLIWgOkWAO3sslL60PqoNe1a2DfALvZhUdWOnqGiMY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)