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

Query time 0.00042