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

Query time 0.00064