UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iCHJx/7qSugy5M7oWLrPxMcpHpgTFz1jAeabDjc4XsM=' 
WHERE 
  key_id = '2d87d2169a6996c45df5052ef5c377b871cd5598d0bc7fc8bb33bba95fa4cd68' 
  AND (
    token = 'iCHJx/7qSugy5M7oWLrPxMcpHpgTFz1jAeabDjc4XsM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032