UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YVA6q/f4KloIUH1KpCyD7GCuvegqj/Q4fbf095LcKn8=' 
WHERE 
  key_id = 'b36f45c0f029c2831fd6dfa0e5f46c2af4e1aceaf99ec6a939a75bd55f073af9' 
  AND (
    token = 'YVA6q/f4KloIUH1KpCyD7GCuvegqj/Q4fbf095LcKn8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025