UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gZeKnvg98b8nIKUjOC1UojC7HQ7rCDf0SMLR8+KvUII=' 
WHERE 
  key_id = '813cc70a54dcd8b980ad218d67257fa9907401ab08287300ede5f27c2c089700' 
  AND (
    token = 'gZeKnvg98b8nIKUjOC1UojC7HQ7rCDf0SMLR8+KvUII=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036