UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qFi3PAUzi40hCOVz991qtzl4vBQOKiRxIezGUuDPnEI=' 
WHERE 
  key_id = '730ccd08037a1428c69751380b173ab5ba0d2f1b52b574239949fb7432e7f3ae' 
  AND (
    token = 'qFi3PAUzi40hCOVz991qtzl4vBQOKiRxIezGUuDPnEI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026