UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm21r/vcPj2hhyOOvFq/Wwr07GbjaA+O5CYnyg9bJEWs=' 
WHERE 
  key_id = '82ab7101599a51e91c2ff5c3c478fc4ea194fb10843dfbba33f4d7791cbdcf9e' 
  AND (
    token = 'm21r/vcPj2hhyOOvFq/Wwr07GbjaA+O5CYnyg9bJEWs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031