UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zhgdyFIC47wgp6T3Z8yHp1XAQ3XaXd8QFpRsnK/oJ0M=' 
WHERE 
  key_id = 'ad27ec3ef7b299bc24c62a72d6c9008d0187c0d1cade5ef7ca6405cd9b41bc28' 
  AND (
    token = 'zhgdyFIC47wgp6T3Z8yHp1XAQ3XaXd8QFpRsnK/oJ0M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059