UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p5sWZER7om+0ACa9lGYt0UxnE8o4wZYOlbnsO9R55wI=' 
WHERE 
  key_id = '3e7dc770ba27cf7758c3a65ccab1404282d95cc1e5c2ae9250c8c22cc52cb61c' 
  AND (
    token = 'p5sWZER7om+0ACa9lGYt0UxnE8o4wZYOlbnsO9R55wI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033