UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z7hN1k4PcfJYmsAIu/Pqnhdlr6GcPQtZy1U8XuXpYfQ=' 
WHERE 
  key_id = 'c90c09a775f790bca6ea23a6a6cce7235e93818fe6eb6eb495beeb9c56b27d00' 
  AND (
    token = 'Z7hN1k4PcfJYmsAIu/Pqnhdlr6GcPQtZy1U8XuXpYfQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024